<?php

ob_start();
include_once "../connect.php";
// รับค่ามาเก็บไว้ใน 
$alt_Id = $_POST["alt_Id"];
$de_id = $_POST["de_id"];
$cn_id = $_POST["cn_id"];
$alt_Program = $_POST["chkProgram"];
$alt_Device = $_POST["chkDevice"];
$alt_Error = $_POST["txtError"];
$emp_id = $_POST["txtEmpid"];

if (!empty($alt_Id)) {
    $sql = "UPDATE `db_itmanager`.`altcomservice` SET
`alt_Date` = NOW(),
`alt_Time` = NOW(),
`alt_Program` = '$alt_Program',
`alt_Device` = '$alt_Device',  
`alt_Error` = '$alt_Error',
`alt_create` = NOW() 
WHERE `altcomservice`.`alt_Id` = '$alt_Id' ";
} else {

    header("location:serviceCom.php"); 
}
if (mysql_query($sql)) {

    //  header("location:listCom.php");
    echo "<script language='javascript'>
			   alert('Complete');
			   setTimeout(\"parent.$.fancybox.close()\",1000); 
			  </script>";
    echo "<meta http-equiv='refresh' content='5; url=listCom.php'>";
} else {
    echo mysql_error();
}
?>
